 <html>
  <head>
   <title>Testni</title>
	<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js>
	var Type;
    var Url;
    var ContentType;
    var DataType;
    var ProcessData;
	
	function load() 
	{
		Type = "POST";
		Url = "http://localhost:52260/PosrednikStoritev.svc/Sinf_StukProg";
		ContentType = "application/json; charset=utf-8";
		DataType = "json"; 
		ProcessData = true; 
		CallService();
	}
		
	function CallService() 
	{
		$.ajax({
			type: Type,
			url: Url,
			contentType: ContentType,
			dataType: DataType,
			processdata: ProcessData,
			success: function(msg) 
			{
				ServiceSucceeded(msg);
			},
			error: ServiceFailed
		});
	}

	function ServiceFailed(result) 
	{
		alert('Service call failed: ' + result.status + '' + result.statusText);
		Type = null;
		Url = null;
		Data = null; 
		ContentType = null;
		DataType = null;
		ProcessData = null;
	}
	
	function ServiceSucceeded(result)
	{
		if (DataType == "json") 
		{
			resultObject = result.GetUserResult;
			
			for (i = 0; i < resultObject.length; i++) {
				alert(resultObject[i]);
			}
				
		} 
	}
	
	function ServiceFailed(xhr) 
	{
		alert(xhr.responseText);

		if (xhr.responseText) {
			var err = xhr.responseText;
			if (err)
				error(err);
			else
				error({ Message: "Unknown server error." })
		}	
		return;
	}
	
	$(document).ready(
    function() 
	{
        load();
    }
	);
    </script>
   </head>
  <body onload="load()"></body>
 </html>  


